#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
long long n,m,l,k,p,qwq[N],qwq1[N],r,dp[N],bj[N],bj1[N],top,x[N],y[N],fa[N],dep[N];
vector<int>q[N];
void dfs(int i)
{
	dep[i]=dep[fa[i]]+1;
	bj1[i]=1;
	for(int j=0;j<q[i].size();++j)
	{
		if(q[i][j]==bj1[i]) continue;
		fa[q[i][j]]=i;
		dfs(q[i][j]);
		if(dp[q[i][j]]&&dp[i])
			++top,x[top]=dp[i],y[top]=dp[q[i][j]],dp[i]=0;
		else dp[i]=max(dp[i],dp[q[i][j]]);
	}
	if(bj[i])
	{
		if(dp[i]) ++top,x[top]=dp[i],y[top]=i;
		else dp[i]=i;
	}
}
void cx(int x,int y)
{
	int top1=0,top2=0;
	while(x!=y)
	{
		if(dep[x]<dep[y])
		{
			++top2,qwq1[top2]=y;
			y=fa[y];
		}
		else {
			++top1,qwq[top1]=x;
			x=fa[x];
		}
	}
	cout<<top1+top2+1<<" ";
	for(int i=1;i<=top1;++i)
		cout<<qwq[i]<<" ";
	cout<<x<<" ";
	for(int i=top2;i>=1;--i)
		cout<<qwq1[i]<<" ";
	cout<<'\n'; 
}
int main()
{
	freopen("travel.in","r",stdin);
	freopen("travel.out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>m>>k;
	for(int i=1;i<=m;++i)
		cin>>l>>r,q[l].push_back(r),q[r].push_back(l);
	for(int i=1;i<=k;++i)
		cin>>p,bj[p]=1;
	for(int i=1;i<=n;++i)
		if(!bj1[i]) dfs(i);
	cout<<top<<'\n';
	for(int i=1;i<=top;++i)
		cx(x[i],y[i]);
	return 0; 
}
